# coding: utf-8
from application import db


class User(db.Model):
    __tablename__ = 'user'

    uid = db.Column(db.Integer, primary_key=True, info='唯一ID')
    nickname = db.Column(db.String(64), info='昵称')
    icon = db.Column(db.String(128), info='头像')
    created_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='创建时间')
    updated_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='修改时间')
    email = db.Column(db.String(64), info='邮箱')
    password = db.Column(db.String(128), info='密码')
    salt = db.Column(db.String(64), info='盐')
    banned = db.Column(db.Integer, info='是否被封')
    is_delete = db.Column(db.Integer, info='是否被删')
    create_device_id = db.Column(db.String(128), info='创建设备ID')
    created_ip = db.Column(db.String(32), info='创建IP')
    last_login_ip = db.Column(db.String(32), info='最后登录时IP')
    banned_reason = db.Column(db.String(255), info='被封原因')
    extflags = db.Column(db.Integer, info='允许充值/提现')
    os = db.Column(db.String(32), info='系统')
    last_device_id = db.Column(db.String(128), info='最后登录设备ID')
